import { http } from '@/server'
import type { HttpResponsePending } from '@/server/interface'
import type { LoginFormType, LoginInfo, WebsiteItem } from './interface'

/** 监管、讲师登录 */
export const organOrTeacherLoginApi = (data: LoginFormType): HttpResponsePending<LoginInfo> =>
    http.post(`/oauth/token`, data)

/** 机构登录 */
export const companyLoginApi = (data: LoginFormType): HttpResponsePending =>
    http.post('/oauth/account-token', data)

/** 获取 站点列表 */
export const getWebsiteList = (): HttpResponsePending<WebsiteItem[]> =>
    http.post('/o/v1/systems/get-config', { code: 'WEBSITE' })
